cmake_minimum_required (VERSION 2.6)
project ("Distribuidos")

set(SRC_DIR ./)
set(SRC_DIR_MARIANO ${SRC_DIR}mariano/)
set(OUT_DIR "out/")
set(CMAKE_BUILD_TYPE Debug)

include_directories("${SRC_DIR}")
include_directories("${SRC_DIR}IPC")
include_directories("${SRC_DIR}common")
include_directories("${SRC_DIR}middleware")
include_directories("${SRC_DIR_MARIANO}")
include_directories("${SRC_DIR_MARIANO}comun")
include_directories("${SRC_DIR_MARIANO}api")
include_directories("${SRC_DIR_MARIANO}middleware/controladores")
include_directories("${SRC_DIR_MARIANO}comun/objetosComunes")
include_directories("${SRC_DIR_MARIANO}objetosCompartidos")

AUX_SOURCE_DIRECTORY ("${SRC_DIR}common" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}IPC" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}logger" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}application" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}middleware" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR_MARIANO}comun"                    COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR_MARIANO}api"                      COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR_MARIANO}middleware/controladores" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR_MARIANO}comun/objetosComunes"     COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR_MARIANO}objetosCompartidos"       COMMON_SRC)

file(MAKE_DIRECTORY ${OUT_DIR})
file(MAKE_DIRECTORY ${OUT_DIR}tests/)
file(MAKE_DIRECTORY ${OUT_DIR}tests/ipc)

#add_executable(${OUT_DIR}tests/ipc/mqinit ${SRC_DIR}tests/msgqueue/mqinit.cpp ${SRC_DIR}tests/msgqueue/MyMessage.cpp ${COMMON_SRC}) 
#add_executable(${OUT_DIR}tests/ipc/mqsend ${SRC_DIR}tests/msgqueue/mqsend.cpp ${SRC_DIR}tests/msgqueue/MyMessage.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}cliente ${SRC_DIR}control/cliente.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}vendedor ${SRC_DIR}control/vendedor.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}adpt ${SRC_DIR}control/adpt.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}despacho ${SRC_DIR}control/despacho.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}robot16 ${SRC_DIR}control/robot16.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}mockRobot14 ${SRC_DIR}control/mockRobot14.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}launcher ${SRC_DIR}control/launcher.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}terminator ${SRC_DIR}control/terminator.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}agv ${SRC_DIR}control/agv.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}pedidos ${SRC_DIR}control/MockPedidosProduccion.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}robot5 ${SRC_DIR}control/robot5.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}adp ${SRC_DIR}control/adp.cpp ${COMMON_SRC}) 
add_executable(${OUT_DIR}robot11 ${SRC_DIR}control/robot11.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}robot12 ${SRC_DIR}control/robot12.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}launcherM    ${SRC_DIR_MARIANO}aplicacion/launcher.cpp       ${COMMON_SRC})
add_executable(${OUT_DIR}controlR11A ${SRC_DIR_MARIANO}aplicacion/controlRobot11A.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}controlR11B ${SRC_DIR_MARIANO}aplicacion/controlRobot11B.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}controlR14  ${SRC_DIR_MARIANO}aplicacion/controlRobot14.cpp  ${COMMON_SRC})
add_executable(${OUT_DIR}controlR16  ${SRC_DIR_MARIANO}aplicacion/controlRobot16.cpp  ${COMMON_SRC})
add_executable(${OUT_DIR}terminatorM  ${SRC_DIR_MARIANO}aplicacion/terminator.cpp     ${COMMON_SRC})